1. Field of the Invention
The present invention relates to technology for coding and decoding a picture, and particularly, technology for coding and decoding in a screen.
2. Description of the Related Art
As a representative example of a compression coding system of moving pictures, the standard of MPEG-4 AVC/H.264 is known. In MPEG-4 AVC/H.264, coding is performed in units of macro blocks obtained by dividing a picture into a plurality of rectangular blocks. A size of the macro block is defined as 16×16 pixels in a brightness signal, regardless of a picture size. A color-difference signal is also included in the macro block. However, a size of the color-difference signal included in the macro block is different according to a color-difference format of a coded picture. When the color-difference format is 4:2:0, the size of the color different signal is defined as 8×8 pixels, when the color-difference format is 4:2:2, the size of the color different signal is defined as 8×16 pixels, and when the color-difference format is 4:4:4, the size of the color different signal is defined as 16×16 pixels.
In the color-difference format, a ratio of sampled pixel numbers of three signals of one piece of brightness information and two pieces of color-difference information is represented by X:Y:Z. As examples of a color-difference format of a picture to be coded and decoded by MPEG-4 AVC/H.264, 4:2:0, 4:2:2, 4:4:4, and a monochrome are known.
FIGS. 3A to 3E are a diagram illustrating each color-difference format of a picture. x shows a position of a pixel of a brightness signal of a picture on a screen plane and ∘ shows a position of a pixel of a color-difference signal.
4:2:0 illustrated in FIG. 3A is a color-difference format in which a color-difference signal is sampled at a density of ½ in both horizontal and vertical directions, with respect to a brightness signal. That is, in 4:2:0, aspect ratios of pixels of the brightness signal and the color-difference signal are equal to each other. In 4:2:0, the color-difference signal may be sampled at a position illustrated in FIG. 3E.
4:2:2 illustrated in FIG. 3B is a color-difference format in which a color-difference signal is sampled at a density of ½ in a horizontal direction and at the same density in a vertical direction, with respect to a brightness signal. That is, in 4:2:2, aspect ratios of pixels of the brightness signal and the color-difference signal are different from each other.
4:4:4 illustrated in FIG. 3C is a color-difference format in which both a brightness signal and a color-difference signal are sampled at the same density. That is, in 4:4:4, aspect ratios of pixels of the brightness signal and the color-difference signal are equal to each other.
The monochrome illustrated in FIG. 3D is a color-difference format configured using only a brightness signal without using a color-difference signal.
The brightness signal and the color-difference signal are set to share coding information such as motion compensation with each other and are coded and decoded. However, in 4:4:4, a mechanism for coding and decoding one brightness signal and two color-difference signals as three monochromes independently is also prepared.
In a system of AVC/H.264, a method of executing prediction from a block coded/decoded in a coding/decoding target picture is used. This method is called intra-prediction. In addition, motion compensation to predict a motion from a reference picture using a coded/decoded picture as the reference picture is used. A method of predicting the motion by the motion compensation is called inter-prediction.
First, switching units of an intra-prediction mode by the intra-prediction in intra-coding of the system of AVC/H.264 will be described. FIGS. 4A to 4C are diagrams illustrating the switching units of the intra-prediction mode. In the intra-coding of the system of AVC/H.264, three types of “4×4 intra-prediction”, “16×16 intra-prediction”, and “8×8 intra-prediction” are prepared as the switching units of the intra-prediction mode.
In the “4×4 intra-prediction”, a brightness signal of a macro block (a brightness signal of 16×16 pixel blocks and a color-difference signal of 8×8 pixel blocks) is divided into 16 parts of 4×4 pixel blocks, a mode is selected from nine types of 4×4 intra-prediction modes in 4×4 pixel units divided, and the intra-prediction is sequentially performed (FIG. 4A).
In the “16×16 pixel intra-prediction”, a mode is selected from four types of 16×16 intra-prediction modes in 16×16 pixel block units of a brightness signal and the intra-prediction is performed (FIG. 4B).
In the “8×8 pixel intra-prediction”, a brightness signal of a macro block is divided into 4 parts of 8×8 pixel blocks, a mode is selected from nine types of 8×8 intra-prediction modes in 8×8 pixel units divided, and the intra-prediction is sequentially performed (FIG. 4C).
In addition, in the intra-prediction of the color-difference signal, when the color-difference format is 4:2:0 or 4:2:2, a mode is selected from four types of intra-prediction modes of the color-difference signal in macro block units and the intra-predictions are performed.
Next, units of the inter-prediction in inter coding of the system of AVC/H.264 will be described. FIGS. 5A to 5H are diagrams illustrating macro block partition and sub-macro block partition. Here, only a pixel block of a brightness signal is illustrated for the simplification of explanation. In MPEG series, a macro block is defined by a square region. Generally, in the MPEG series including the system of AVC/H.264, a block defined by 16×16 pixels (16 pixels in a horizontal direction and 16 pixels in a vertical direction) is called a macro block. In addition, in the system of AVC/H.264, a block defined by 8×8 pixels is called a sub-macro block. The macro block partition means each of small blocks obtained by dividing the macro block for the sake of motion compensation and prediction. The sub-macro block partition means each of small blocks obtained by dividing the sub-macro block for the sake of the motion compensation and prediction.
FIG. 5A is a diagram illustrating the case in which a macro block is configured from one macro block partition configured from a brightness signal of 16×16 pixels and two color-difference signals corresponding to the brightness signal. Here, this configuration is called a macro block type of a 16×16 mode.
FIG. 5B is a diagram illustrating the case in which a macro block is configured from two macro block partitions configured from a brightness signal of 16×8 pixels (16 pixels in a horizontal direction and 8 pixels in a vertical direction) and two color-difference signals corresponding to the brightness signal. The two macro block partitions are arranged vertically. Here, this configuration is called a macro block type of a 16×8 mode.
FIG. 5C is a diagram illustrating the case in which a macro block is configured from two macro block partitions configured from a brightness signal of 8×16 pixels (8 pixels in a horizontal direction and 16 pixels in a vertical direction) and two color-difference signals corresponding to the brightness signal. The two macro block partitions are arranged horizontally. Here, this configuration is called a macro block type of an 8×16 mode.
FIG. 5D is a diagram illustrating the case in which a macro block is configured from four macro block partitions configured from a brightness signal of 8×8 pixels and two color-difference signals corresponding to the brightness signal. The four macro block partitions are arranged two by two vertically and horizontally. Here, this configuration is called a macro block type of an 8×8 mode.
FIG. 5E is a diagram illustrating the case in which a sub-macro block is configured from one sub-macro block partition configured from a brightness signal of 8×8 pixels and two color-difference signals corresponding to the brightness signal. Here, this configuration is called a sub-macro block type of an 8×8 mode.
FIG. 5F is a diagram illustrating the case in which a sub-macro block is configured from two sub-macro block partitions configured from a brightness signal of 8×4 pixels (8 pixels in a horizontal direction and 4 pixels in a vertical direction) and two color-difference signals corresponding to the brightness signal. The two sub-macro block partitions are arranged vertically. This configuration is called a sub-macro block type of an 8×4 mode.
FIG. 5G is a diagram illustrating the case in which a sub-macro block is configured from two macro block partitions configured from a brightness signal of 4×8 pixels (4 pixels in a horizontal direction and 8 pixels in a vertical direction) and two color-difference signals corresponding to the brightness signal. The two macro block partitions are arranged horizontally. Here, this configuration is called a sub-macro block type of a 4×8 mode.
FIG. 5H is a diagram illustrating the case in which a sub-macro block is configured from four sub-macro block partitions configured from a brightness signal of 4×4 pixels and two color-difference signals corresponding to the brightness signal. The four sub-macro block partitions are arranged two by two vertically and horizontally. Here, this configuration is called a sub-macro block type of a 4×4 mode.
In the coding system of AVC/H.264, a mechanism for selectively using the motion compensation block sizes is taken. First, any macro block type can be selected as the motion compensation block size of the macro block unit, from the macro block types of the 16×16, 16×8, 8×16, and 8×8 modes. When the macro block type of the 8×8 mode is selected, any sub-macro block type can be selected as the motion compensation block size of the sub-macro block unit, from the sub-macro block types of the 8×8, 8×4, 4×8, and 4×4 modes.